<template>
  <div>
     <div >{{str}}</div>
     <button @click="change"> 逆转</button>
   </div>
</template>
 
<script>
export default {
  
  data() {
    return {
      str:'hello,hangzhou'
    };
  },
  
  methods: {
    change(){
      /* split('')转换成数组 reverse()反转数组  join('')装换成字符串 */
      this.str = this.str.split('').reverse().join('')
  }
  }
};
</script>

<style scoped>
     
</style>